\(\int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx\) [17]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 25 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {a \cot (c+d x)}{d}+\frac {b \log (\tan (c+d x))}{d} \]

[Out]

-a*cot(d*x+c)/d+b*ln(tan(d*x+c))/d

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {45} \[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {b \log (\tan (c+d x))}{d}-\frac {a \cot (c+d x)}{d} \]

[In]

Int[Csc[c + d*x]^2*(a + b*Tan[c + d*x]),x]

[Out]

-((a*Cot[c + d*x])/d) + (b*Log[Tan[c + d*x]])/d

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {a+b x}{x^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (\frac {a}{x^2}+\frac {b}{x}\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = -\frac {a \cot (c+d x)}{d}+\frac {b \log (\tan (c+d x))}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.52 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {a \cot (c+d x)}{d}-\frac {b \log (\cos (c+d x))}{d}+\frac {b \log (\sin (c+d x))}{d} \]

[In]

Integrate[Csc[c + d*x]^2*(a + b*Tan[c + d*x]),x]

[Out]

-((a*Cot[c + d*x])/d) - (b*Log[Cos[c + d*x]])/d + (b*Log[Sin[c + d*x]])/d

Maple [A] (verified)

Time = 0.43 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {-\frac {a}{\tan \left (d x +c \right )}+b \ln \left (\tan \left (d x +c \right )\right )}{d}\) \(26\)
default \(\frac {-\frac {a}{\tan \left (d x +c \right )}+b \ln \left (\tan \left (d x +c \right )\right )}{d}\) \(26\)
risch \(-\frac {2 i a}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(57\)

[In]

int(csc(d*x+c)^2*(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/tan(d*x+c)*a+b*ln(tan(d*x+c)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 62 vs. \(2 (25) = 50\).

Time = 0.26 (sec) , antiderivative size = 62, normalized size of antiderivative = 2.48 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {b \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - b \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) + 2 \, a \cos \left (d x + c\right )}{2 \, d \sin \left (d x + c\right )} \]

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(b*log(cos(d*x + c)^2)*sin(d*x + c) - b*log(-1/4*cos(d*x + c)^2 + 1/4)*sin(d*x + c) + 2*a*cos(d*x + c))/(
d*sin(d*x + c))

Sympy [F]

\[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right ) \csc ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate(csc(d*x+c)**2*(a+b*tan(d*x+c)),x)

[Out]

Integral((a + b*tan(c + d*x))*csc(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {b \log \left (\tan \left (d x + c\right )\right ) - \frac {a}{\tan \left (d x + c\right )}}{d} \]

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

(b*log(tan(d*x + c)) - a/tan(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.40 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) - \frac {b \tan \left (d x + c\right ) + a}{\tan \left (d x + c\right )}}{d} \]

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

(b*log(abs(tan(d*x + c))) - (b*tan(d*x + c) + a)/tan(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 4.17 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x)) \, dx=\frac {b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {a\,\mathrm {cot}\left (c+d\,x\right )}{d} \]

[In]

int((a + b*tan(c + d*x))/sin(c + d*x)^2,x)

[Out]

(b*log(tan(c + d*x)))/d - (a*cot(c + d*x))/d